#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>

LEAF(my6_msub_test)
    .set noreorder
    addiu s0, s0 ,1
    addiu s2, zero, 0x0
    lui   t2, 0x1
###test inst

    LI (t0,0x2222);
    LI (t1,0x3333);
    mtlo t0;
    mthi t1;
    LI (t2,0x4444);
    LI (t3,0x5555);
    msub t0,t1;
    msub t1,t2;
    msub t2,t3;
    TEST_MType(0xad32d1c7,0xca9d0615,0xb0f493ac,0x6883611d,0xc41572ff,0x79c7df11,msub)
    TEST_MType(0xb43de0e6,0xde843a51,0x0b63fb65,0xc909b7fc,0x8284402b,0xd2f25ec4,msub)
    TEST_MType(0xc3581c15,0x0e5d9cd7,0xb89ee8e9,0xa6c018ae,0xd25c4a8c,0xa358bc11,msub)
    TEST_MType(0x6b119dae,0xb4ff6188,0x26705715,0xd48392e7,0x1cdd0985,0xb525276e,msub)
    TEST_MType(0x0de82135,0x9b9d76e2,0x0cf4081b,0x06281ebf,0xc7b0c6e5,0x00b41777,msub)
    TEST_MType(0xd53aa408,0xc6564580,0xf5ede78e,0xb932bf46,0xac26138e,0xc2d50c34,msub)
    TEST_MType(0x7df1b9e4,0x8ca60733,0xabdb1548,0xf3fc845a,0x98f059b4,0xbb3caa69,msub)
    TEST_MType(0x3fcd2580,0x3453576f,0xdbc875a4,0x3f49f5d7,0x65fa3824,0x4c5466c3,msub)
    TEST_MType(0x8093fd81,0xc24af870,0x674377a2,0xa57c9476,0x0ee15812,0xc4336c30,msub)
    TEST_MType(0x9f6703d2,0x9e183028,0x73525d24,0x200348f7,0xa3d255f4,0x44f4b8fe,msub)
    TEST_MType(0x6a9b5448,0xfa4b2cb7,0x0f127200,0xde94174b,0xf7b01178,0xdc33c172,msub)
    TEST_MType(0x5a3c1cef,0x24c7430d,0x3e4934de,0xbef0a124,0xa8b23a01,0xcbe75193,msub)
    TEST_MType(0x21d299b2,0xf18afbe8,0x40485bac,0x978e5463,0xcfc92afc,0x95a55a31,msub)
    TEST_MType(0x3fb7e638,0x4542b9d3,0x8ef40124,0x78bddf13,0x6b55394c,0x89fb0bca,msub)
    TEST_MType(0x4286249d,0x279b8828,0xfb55ef18,0x08a84cfe,0xb9ce0fa0,0x12f3272d,msub)
    TEST_MType(0xdc78a34c,0x60a46263,0x494fad92,0x5ef87e53,0xd729ebf6,0x518eeb31,msub)
    TEST_MType(0x068ac6cd,0x7b5c9f81,0x67a6f881,0xb5478784,0xd5ba78ce,0xb86e92fc,msub)
    TEST_MType(0x31f9baf8,0xfa1d0251,0xf5798130,0x7465b27b,0x170b99a8,0x733f81d8,msub)
    TEST_MType(0x885e469b,0x2467d16a,0xc3380988,0xb2c18aec,0x6642d0b6,0xa1be48ec,msub)
    TEST_MType(0x6f1562d1,0xfb60afe3,0x94795766,0x9f6d51fd,0xac5cd5b9,0x9d6bdb67,msub)
    TEST_MType(0xc9cdd568,0xef10731a,0x58129205,0x46df45e0,0xbc57f695,0x4a751f34,msub)
    TEST_MType(0x9aaadf3f,0x12f0b8a7,0xdd4324b0,0xb18ccc84,0x4c400ec9,0xaa0d8751,msub)
    TEST_MType(0x210b447f,0x01b571f3,0x8a91a9c2,0xeeaf466e,0xce4abd4f,0xeee7bd60,msub)
    TEST_MType(0x1edd427f,0x38b61c5e,0xd5177f6a,0xac7b46e0,0x6be5ce0c,0xb351a225,msub)
    TEST_MType(0x793b0512,0x028faa6e,0x8818f999,0xcc44ae68,0xc9e11b55,0xcd7b2d20,msub)
    TEST_MType(0x1d5ce686,0xe82b402a,0x1844740a,0x303a7d24,0x4ba5c606,0x2d7ebd7e,msub)
    TEST_MType(0x97de7d62,0x73ff1fba,0xbd60b052,0x69d03ec7,0xf0d4a786,0x3aa16ad2,msub)
    TEST_MType(0xe5310ae8,0xdf76f840,0x039abdd8,0xd3cb0c04,0xf15e37d8,0xd7334438,msub)
    TEST_MType(0xb52aafa3,0x44bfdbb7,0x1c003153,0x3080f92f,0x78612fd8,0x1c683a75,msub)
    TEST_MType(0x3cba3a1e,0x80a4f451,0x307b3752,0x93470676,0x220432d0,0x75110aa9,msub)
    TEST_MType(0x5c0df89f,0x23fc7abe,0x1d7a2740,0xd9cd610b,0x91d87342,0xe6be13ed,msub)
    TEST_MType(0x51f56cc1,0x0fab44fa,0xaa832e17,0x636fcbbe,0xd8fda691,0x68740223,msub)
    TEST_MType(0x9c2b9908,0x8d34212a,0x68f76921,0x452f9701,0x24788c71,0x71f3ad2f,msub)
    TEST_MType(0xbc8eec69,0x6992c6b3,0x9a2cfa89,0x8b6b07b4,0xe1d77df4,0x6f9afbd6,msub)
    TEST_MType(0x47b3fbbf,0x656fcbc5,0x24d874e0,0xa4c4a33d,0x8dcaa3db,0xc12df5ad,msub)
    TEST_MType(0x387cabab,0x24c1fdcf,0x9ea8e1ac,0x493a58c5,0xf90aaff1,0x5156aee8,msub)
    TEST_MType(0xc5962234,0x46ff4dd8,0x2a942729,0xd01e0311,0x5356a709,0xbfeacf34,msub)
    TEST_MType(0x2a41b3e6,0x83c2fef8,0xd143bc55,0x57229593,0xf7b43725,0x42a0b09d,msub)
    TEST_MType(0x80908c8d,0x05db4d18,0x53cb358e,0xcd1abf7a,0xd93dcbc6,0xca306781,msub)
    TEST_MType(0x132aa6b9,0x3ebde501,0x48e47288,0xf663c62d,0x67c79641,0xfb165230,msub)
    TEST_MType(0xabc8de59,0xfeec21b5,0x59695b63,0xc14fbc55,0xfb240950,0xc1aa7caf,msub)
    TEST_MType(0x6ad10697,0x7787e088,0xd6f9e0ff,0x113cb813,0x266a8137,0x431c940e,msub)
    TEST_MType(0x9dc6f278,0xe8813bbc,0x67318072,0x8ec21abe,0x0da53892,0x97c5de58,msub)
    TEST_MType(0x27dff312,0xc51029eb,0xb36a970c,0x3b0715e0,0x370c9a92,0x31d8fd62,msub)
    TEST_MType(0x0bc27f8e,0xcd2e7b16,0x5c91ba91,0x4211bda3,0x7415eac5,0x3fbc20d4,msub)
    TEST_MType(0xd446736c,0x5203c0d0,0x4c80a5bf,0x86001598,0x8e936d7f,0x77fe0276,msub)
    TEST_MType(0xa1e7c9fc,0x5ca0e1cc,0x18796bb2,0x157e87a6,0xa334dc82,0xf372b21d,msub)
    TEST_MType(0x942cf5e2,0xebad601c,0x47cfb36b,0x2594172e,0xf8a95823,0x2e2360ea,msub)
    TEST_MType(0x86e7870c,0x23b79da9,0x17dd6b23,0x5cfa88b2,0x521bee0f,0x4c155516,msub)
    TEST_MType(0xe5484027,0x4ff9886e,0xdd2a2202,0x6822b18e,0x33396ac4,0x5fc9f264,msub)



    TEST_MType(0x00000000,0x43b34456,0xaa309260,0x08ed6f2b,0xaa309260,0x08ed6f2c,msub)
    TEST_MType(0x00000000,0x8443477b,0x9c6e8235,0xad2114f1,0x9c6e8235,0xad2114f2,msub)
    TEST_MType(0x00000000,0x4fbfa773,0x94ba7a7d,0x1620ff47,0x94ba7a7d,0x1620ff48,msub)
    TEST_MType(0x00000000,0x500a2f34,0x7f5daaf6,0xe696f5d5,0x7f5daaf6,0xe696f5d5,msub)
    TEST_MType(0x00000000,0xa70d2ace,0xe80fd955,0x16d3729e,0xe80fd955,0x16d3729f,msub)
    TEST_MType(0x00000000,0xfdf9e579,0x49fe209b,0x67cd5eaf,0x49fe209b,0x67cd5eaf,msub)
    TEST_MType(0x00000000,0x14f443fa,0x94319410,0x8e0f3993,0x94319410,0x8e0f3994,msub)
    TEST_MType(0x00000000,0x094caebc,0x1e6b96b7,0xdc6d2ea7,0x1e6b96b7,0xdc6d2ea7,msub)
    TEST_MType(0x00000000,0xbcfa09cc,0xa19a1517,0xdfe58e40,0xa19a1517,0xdfe58e41,msub)
    TEST_MType(0x00000000,0x9afe6b95,0x88fa6e25,0x6992fd12,0x88fa6e25,0x6992fd13,msub)
    TEST_MType(0x00000000,0xce0de07e,0xd6637bb1,0x9a8ed2bb,0xd6637bb1,0x9a8ed2bc,msub)
    TEST_MType(0x00000000,0x851793cd,0xee8c6b19,0xb5e57e13,0xee8c6b19,0xb5e57e14,msub)
    TEST_MType(0x00000000,0x2907ca64,0x66f9e0f5,0xd6ae303a,0x66f9e0f5,0xd6ae303a,msub)
    TEST_MType(0x00000000,0xf634d67e,0x5b22574b,0x41217031,0x5b22574b,0x41217031,msub)
    TEST_MType(0x00000000,0x4fa8b5b3,0x16f675a1,0x91ea7149,0x16f675a1,0x91ea7149,msub)
    TEST_MType(0x00000000,0x011dc377,0x07793877,0x4690f02f,0x07793877,0x4690f02f,msub)
    TEST_MType(0x00000000,0x1be0eb90,0xc745094a,0x12b61366,0xc745094a,0x12b61367,msub)
    TEST_MType(0x00000000,0xf9b9e69d,0xf0209c82,0xf1d938a6,0xf0209c82,0xf1d938a7,msub)
    TEST_MType(0x00000000,0x1d46b712,0x12e96004,0xb1ba1fe7,0x12e96004,0xb1ba1fe7,msub)
    TEST_MType(0x00000000,0x6c0c72db,0x1a9be8f4,0xe1b26a46,0x1a9be8f4,0xe1b26a46,msub)
    TEST_MType(0x00000000,0x324744f2,0x7f613ca1,0x81112c8c,0x7f613ca1,0x81112c8c,msub)
    TEST_MType(0x00000000,0x018fd2fb,0xb3638994,0x8cdd3c1d,0xb3638994,0x8cdd3c1e,msub)
    TEST_MType(0x00000000,0x58891e9d,0xe43a3f43,0x37309660,0xe43a3f43,0x37309661,msub)
    TEST_MType(0x00000000,0x0bf37a9c,0xaa2593b9,0xfc3cce4c,0xaa2593b9,0xfc3cce4d,msub)
    TEST_MType(0x00000000,0xacfe61c5,0x7b07ceff,0xc947d596,0x7b07ceff,0xc947d596,msub)
    TEST_MType(0x00000000,0xb21ba2fd,0x47fe97ba,0x2ad964a8,0x47fe97ba,0x2ad964a8,msub)
    TEST_MType(0x35f42680,0x00000000,0x2a3181fb,0x82a9a1f8,0x2a3181fb,0x82a9a1f8,msub)
    TEST_MType(0x3132af7d,0x00000000,0x338ae8fb,0xa1b343b5,0x338ae8fb,0xa1b343b5,msub)
    TEST_MType(0x7bcb48de,0x00000000,0x033ecc35,0x428e8b17,0x033ecc35,0x428e8b17,msub)
    TEST_MType(0x81da004f,0x00000000,0x517a0900,0x97b1487d,0x517a0900,0x97b1487d,msub)
    TEST_MType(0x10210171,0x00000000,0x0b679ae4,0x89087224,0x0b679ae4,0x89087224,msub)
    TEST_MType(0xfdfa6c99,0x00000000,0xa2dfe176,0x62469bb5,0xa2dfe176,0x62469bb6,msub)
    TEST_MType(0x2e289d36,0x00000000,0xef6aa822,0x90bc5ed5,0xef6aa822,0x90bc5ed6,msub)
    TEST_MType(0x2e2ad0f5,0x00000000,0xe996facc,0x8a7141bc,0xe996facc,0x8a7141bd,msub)
    TEST_MType(0xe6a1a994,0x00000000,0xecd8e0d2,0xa4129d9d,0xecd8e0d2,0xa4129d9e,msub)
    TEST_MType(0x8bcb879a,0x00000000,0x3e45457b,0x5dc0b68d,0x3e45457b,0x5dc0b68d,msub)
    TEST_MType(0x9b3a99df,0x00000000,0x7ca07c11,0xbf7ce6e4,0x7ca07c11,0xbf7ce6e4,msub)
    TEST_MType(0x506ea5e4,0x00000000,0x0527728a,0xe55965d2,0x0527728a,0xe55965d2,msub)
    TEST_MType(0x85f8259a,0x00000000,0x445ad4e2,0x08bc9a56,0x445ad4e2,0x08bc9a56,msub)
    TEST_MType(0xed84c951,0x00000000,0xac93d926,0xbdec983e,0xac93d926,0xbdec983f,msub)
    TEST_MType(0x4d1b701c,0x00000000,0x851e2ad2,0x7690498b,0x851e2ad2,0x7690498c,msub)
    TEST_MType(0xebcfd550,0x00000000,0xf303ac69,0x3b57bed9,0xf303ac69,0x3b57beda,msub)
    TEST_MType(0xc8824583,0x00000000,0xf4ab29f7,0xdbee7f21,0xf4ab29f7,0xdbee7f22,msub)
    TEST_MType(0x316a80aa,0x00000000,0x26c8a4ca,0xe76f5209,0x26c8a4ca,0xe76f5209,msub)
    TEST_MType(0xe44c5d25,0x00000000,0x734aa74b,0x518d08d1,0x734aa74b,0x518d08d1,msub)
    TEST_MType(0x710b0069,0x00000000,0x1493f860,0xc117591e,0x1493f860,0xc117591e,msub)
    TEST_MType(0x1ea63833,0x00000000,0x36a0b634,0x2c543729,0x36a0b634,0x2c543729,msub)
    TEST_MType(0xfb9c53d0,0x00000000,0x513ca03f,0x42fafb32,0x513ca03f,0x42fafb32,msub)
    TEST_MType(0x00cbe209,0x00000000,0x8f0d758b,0x65823a1a,0x8f0d758b,0x65823a1b,msub)
    TEST_MType(0x307495bc,0x00000000,0xfd100638,0xbbe63b6b,0xfd100638,0xbbe63b6c,msub)

###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)
    jr ra
    nop
END(my6_msub_test)
